From 8f1bf594b94df9fc5f49669b7537b2fc16f9877e Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 30 Aug 2020 18:43:33 -0400 Subject: [PATCH] Drop a long-dead test We don't parse rc files anymore. Time for testrc.c to go. --- tests/testrc.c | 75 -------------------------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 tests/testrc.c diff --git a/tests/testrc.c b/tests/testrc.c deleted file mode 100644 index ce1b882977..0000000000 --- a/tests/testrc.c +++ /dev/null @@ -1,75 +0,0 @@ -/* GTK - The GIMP Toolkit - - Copyright (C) 2006 Red Hat, Inc. - Author: Matthias Clasen - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library. If not, see . -*/ - -#include -#include "gtk/gtk.h" - -/* NOTE to compile this test, GTK+ needs to be build without - * the _-prefix stripping. - */ -struct { - char *pattern; - char *test; - gboolean match; -} tests[] = { - { "", "", TRUE }, - { "", "GtkToggleButton", FALSE }, - { "", "GtkCheckButton", TRUE }, - { "", "GtkRadioButton", TRUE }, - { "abc*...*foo", "abcx.GtkToggleButton.GtkLabel.foo", TRUE }, - { "*abc..foo*", "abc.GtkToggleButton.bar", FALSE }, - { "*abc..foo*", "xabc.GtkToggleButton.fox", FALSE }, - { NULL, NULL, FALSE } -}; - -static void -load_types (void) -{ - volatile GType type; - - type = gtk_radio_button_get_type (); - type = gtk_label_get_type (); -} - -int -main (int argc, char *argv[]) -{ - int i; - - gtk_init (); - load_types (); - - for (i = 0; tests[i].test; i++) - { - GSList *list; - char *path, *rpath; - gboolean result; - - list = _gtk_rc_parse_widget_class_path (tests[i].pattern); - path = g_strdup (tests[i].test); - rpath = g_utf8_strreverse (path, -1); - result = _gtk_rc_match_widget_class (list, strlen (path), path, rpath); - g_print ("%d. \"%s\" \"%s\", expected %d, got %d\n", - i, tests[i].pattern, tests[i].test, tests[i].match, result); - g_assert (result == tests[i].match); - g_free (path); - } - - return 0; -} -- 2.30.2